From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment.html From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0001.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0001.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment.html From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0003.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0002.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0001.html From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0004.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0003.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0002.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0005.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0004.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0003.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0006.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0005.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0004.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0007.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0006.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0005.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0008.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0007.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0007.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0001.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0009.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0008.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0008.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0002.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0010.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0009.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0009.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0004.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0002.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0002.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0002.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0002.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0011.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0010.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0010.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0005.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0003.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0003.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0003.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0003.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0001.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0012.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0011.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0011.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0006.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0004.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0004.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0004.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0004.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0002.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0013.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0012.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0012.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0007.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0005.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0005.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0005.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0005.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0004.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0014.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0013.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0013.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0008.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0006.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0006.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0006.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0006.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0005.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0015.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0014.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0014.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0009.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0007.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0007.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0007.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0007.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0006.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0016.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0015.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0015.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0010.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0008.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0008.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0008.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0008.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0007.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment.html From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0017.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0016.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0016.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0011.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0009.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0009.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0009.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0009.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0008.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0001.html From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0018.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0017.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0017.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0012.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0010.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0010.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0010.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0010.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0009.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0002.html From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0019.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0018.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0018.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0013.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0011.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0011.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0011.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0011.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0010.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0003.html From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0020.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0019.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0019.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0014.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0012.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0012.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0012.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0012.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0011.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0004.html From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0021.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0020.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0020.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0015.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0013.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0013.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0013.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0013.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0012.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0005.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0022.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0021.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0021.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0016.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0014.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0014.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0014.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0014.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0013.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0006.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0001.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0023.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0022.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0022.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0017.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0015.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0015.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0015.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0015.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0014.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0007.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0002.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0001.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0024.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0023.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0023.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0018.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0016.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0016.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0016.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0016.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0015.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0009.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0004.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0002.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0025.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0024.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0024.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0019.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0017.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0017.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0017.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0017.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0016.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0010.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0005.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0003.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0003.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0026.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0025.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0025.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0020.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0018.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0018.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0018.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0018.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0017.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0011.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0006.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0004.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0004.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0027.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0026.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0026.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0021.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0019.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0019.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0019.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0019.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0018.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0012.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0007.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0005.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0005.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0028.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0027.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0027.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0022.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0020.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0020.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0020.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0020.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0019.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0013.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0008.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0006.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0006.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0029.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0028.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0028.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0023.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0021.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0021.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0021.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0021.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0020.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0014.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0009.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0007.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0007.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0030.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0029.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0029.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0024.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0022.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0022.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0022.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0022.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0021.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0015.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0010.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0008.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0008.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0031.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0030.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0030.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0025.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0023.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0023.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0023.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0023.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0022.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0016.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0011.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0009.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0009.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0032.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0031.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0031.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0026.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0024.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0024.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0024.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0024.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0023.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0017.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0012.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0010.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0010.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0033.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0032.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0032.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0027.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0025.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0025.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0025.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0025.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0024.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0018.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0013.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0011.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0011.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0034.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0033.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0033.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0028.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0026.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0026.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0026.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0026.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0025.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0019.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0014.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0012.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0012.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0035.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0034.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0034.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0029.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0027.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0027.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0027.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0027.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0026.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0020.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0015.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0013.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0013.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0036.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0035.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0035.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0030.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0028.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0028.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0028.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0028.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0027.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0021.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0016.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0014.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0014.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0037.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0036.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0036.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0031.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0029.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0029.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0029.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0029.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0028.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0022.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0017.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0015.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0015.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0038.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0037.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0037.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0032.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0030.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0030.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0030.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0030.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0029.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0023.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0018.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0016.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0016.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0039.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0038.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0038.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0033.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0031.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0031.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0031.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0031.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0030.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0024.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0019.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0017.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0017.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0040.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0039.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0039.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0034.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0032.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0032.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0032.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0032.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0031.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0025.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0020.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0018.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0018.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0041.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0040.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0040.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0035.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0033.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0033.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0033.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0033.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0032.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0026.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0021.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0019.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0019.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0042.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0041.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0041.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0036.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0034.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0034.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0034.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0034.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0033.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0027.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0022.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0020.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0020.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0043.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0042.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0042.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0037.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0035.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0035.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0035.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0035.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0034.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0028.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0023.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0021.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0021.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0044.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0043.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0043.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0038.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0036.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0036.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0036.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0036.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0035.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0029.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0024.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0022.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0022.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0045.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0044.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0044.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0039.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0037.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0037.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0037.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0037.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0036.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0030.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0025.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0023.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0023.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0046.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0045.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0045.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0040.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0038.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0038.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0038.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0038.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0037.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0031.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0026.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0024.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0024.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0047.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0046.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0046.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0041.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0039.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0039.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0039.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0039.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0038.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0032.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0027.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0025.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0025.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0048.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0047.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0047.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0042.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0040.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0040.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0040.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0040.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0039.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0033.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0028.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0026.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0026.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0049.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0048.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0048.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0043.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0041.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0041.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0041.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0041.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0040.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0034.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0029.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0027.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0027.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0050.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0049.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0049.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0044.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0042.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0042.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0042.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0042.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0041.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0035.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0030.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0028.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0028.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0051.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0050.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0050.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0045.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0043.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0043.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0043.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0043.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0042.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0036.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0031.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0029.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0029.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0052.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0051.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0051.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0046.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0044.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0044.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0044.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0044.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0043.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0037.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0032.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0030.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0030.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0053.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0052.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0052.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0047.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0045.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0045.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0045.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0045.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0044.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0038.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0033.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0031.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0031.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0054.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0053.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0053.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0048.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0046.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0046.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0046.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0046.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0045.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0039.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0034.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0032.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0032.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0055.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0054.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0054.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0049.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0047.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0047.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0047.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0047.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0046.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0040.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0035.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0033.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0033.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0056.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0055.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0055.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0050.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0048.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0048.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0048.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0048.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0047.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0041.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0036.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0034.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0034.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0057.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0056.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0056.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0051.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0049.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0049.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0049.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0049.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0048.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0042.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0037.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0035.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0035.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0058.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0057.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0057.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0052.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0050.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0050.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0050.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0050.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0049.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0043.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0038.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0036.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0036.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0059.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0058.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0058.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0053.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0051.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0051.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0051.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0051.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0050.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0044.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0039.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0037.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0037.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0060.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0059.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0059.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0054.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0052.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0052.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0052.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0052.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0051.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0045.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0040.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0038.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0038.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0061.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0060.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0060.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0055.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0053.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0053.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0053.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0053.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0052.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0046.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0041.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0039.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0039.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0062.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0061.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0061.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0056.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0054.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0054.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0054.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0054.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0053.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0047.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0042.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0040.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0040.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0063.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0062.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0062.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0057.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0055.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0055.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0055.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0055.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0054.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0048.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0043.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0041.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0041.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0064.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0063.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0063.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0058.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0056.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0056.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0056.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0056.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0055.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0049.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0044.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0042.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0042.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0065.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0064.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0064.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0059.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0057.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0057.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0057.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0057.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0056.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0050.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0045.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0043.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0043.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0066.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0065.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0065.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0060.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0058.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0058.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0058.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0058.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0057.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0051.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0046.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0044.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0044.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0067.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0066.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0066.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0061.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0059.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0059.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0059.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0059.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0058.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0052.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0047.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0045.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0045.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0068.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0067.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0067.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0062.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0060.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0060.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0060.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0060.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0059.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0053.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0048.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0046.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0046.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0069.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0068.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0068.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0063.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0061.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0061.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0061.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0061.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0060.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0054.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0049.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0047.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0047.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0070.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0069.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0069.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0064.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0062.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0062.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0062.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0062.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0061.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0055.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0050.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0048.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0048.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0071.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0070.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0070.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0065.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0063.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0063.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0063.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0063.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0062.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0056.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0051.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0049.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0049.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0072.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0071.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0071.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0066.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0064.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0064.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0064.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0064.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0063.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0057.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0052.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0050.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0050.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0073.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0072.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0072.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0067.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0065.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0065.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0065.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0065.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0064.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0058.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0053.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0051.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0051.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0074.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0073.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0073.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0068.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0066.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0066.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0066.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0066.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0065.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0059.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0054.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0052.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0052.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0075.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0074.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0074.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0069.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0067.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0067.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0067.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0067.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0066.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0060.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0055.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0053.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0053.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0076.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0075.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0075.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0070.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0068.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0068.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0068.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0068.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0067.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0061.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0056.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0054.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0054.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0077.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0076.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0076.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0071.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0069.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0069.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0069.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0069.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0068.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0062.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0057.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0055.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0055.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0078.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0077.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0077.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0072.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0070.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0070.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0070.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0070.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0069.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0063.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0058.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0056.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0056.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0079.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0078.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0078.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0073.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0071.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0071.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0071.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0071.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0070.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0064.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0059.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0057.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0057.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0080.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0079.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0079.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0074.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0072.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0072.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0072.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0072.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0071.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0065.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0060.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0058.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0058.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0081.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0080.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0080.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0075.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0073.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0073.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0073.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0073.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0072.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0066.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0061.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0059.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0059.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago. I will now check the settings on X-CODE and see if I can compile for the Intel Chip with the 64 bits turned on. Or if anyone out there has already solved this problem I would be grateful if they would share this with me. -- Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 fabioanjos at gmail.com Tue Nov 4 04:01:31 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Tue, 4 Nov 2008 09:01:31 -0200 Subject: [Rxtx] Strange characters when reading from Serial port Message-ID: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Dear friends, We are using RXTX in our software since last april and we have succeded in most cases. But, in some clients we could observe a strage behaviour. In normal operation, the application reads data from serial port like the example below: 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 18CC20E32101000 (toString) Where 20, is the block terminator. Suddenly, the application starts to read strage characters from the same serial port: 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 The application continues to read strange chars from the serial port, until we restart it. We are using the RXTX 2.1.7 Here is the code used to read serial port: /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ // @Override *public* *void* serialEvent(SerialPortEvent event) { *switch* (event.getEventType()) { *case* SerialPortEvent.*BI*: *case* SerialPortEvent.*OE*: *case* SerialPortEvent.*FE*: *case* SerialPortEvent.*PE*: *case* SerialPortEvent.*CD*: *case* SerialPortEvent.*CTS*: *case* SerialPortEvent.*DSR*: *case* SerialPortEvent.*RI*: *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: *break*; *case* SerialPortEvent.*DATA_AVAILABLE*: *try* { String result = ""; *byte*[] buffer = *new* *byte*[10]; *int* len = 0; *while* ((len = getPort().getInputStream().read(buffer)) > 0) { result += *new* String(buffer, 0, len); buffer = *new* *byte*[10]; } processInput(result); } *catch* (IOException e) { logger.error("PRPRO01: " + e.getMessage()); } *catch* (Exception e) { logger.error("PRPRO02: " + e.getMessage()); } *break*; } } Any help would be apreciated. Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/46628795/attachment-0082.html From rien.korstanje at gmail.com Tue Nov 4 15:35:31 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Tue, 4 Nov 2008 23:35:31 +0100 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: F?bio, I have encountered a similair problem when using RXTX in combination with a bad Serial-to-USB converter. If you don't have another one at hand, you could also use the Hyper Terminal to see what the Serial Port is delivering. If you aren't using a Serial-to-USB converter, I don't have any suggestions. Regards, -Rien Korstanje On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < fabioanjos at gmail.com> wrote: > Dear friends, > > We are using RXTX in our software since last april and we have succeded in > most cases. > But, in some clients we could observe a strage behaviour. > In normal operation, the application reads data from serial port like the > example below: > > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 > 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) > 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 > 18CC20E32101000 (toString) > > Where 20, is the block terminator. > > Suddenly, the application starts to read strage characters from the same > serial port: > > > 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 > 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 > 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 > 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 > 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 > 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 > 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 > 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 > 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 > 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 > > The application continues to read strange chars from the serial port, > until we restart it. > > We are using the RXTX 2.1.7 > > Here is the code used to read serial port: > > > /* (non-Javadoc) > > * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) > > */ > > // @Override > > *public* *void* serialEvent(SerialPortEvent event) { > > > > *switch* (event.getEventType()) { > > *case* SerialPortEvent.*BI*: > > *case* SerialPortEvent.*OE*: > > *case* SerialPortEvent.*FE*: > > *case* SerialPortEvent.*PE*: > > *case* SerialPortEvent.*CD*: > > *case* SerialPortEvent.*CTS*: > > *case* SerialPortEvent.*DSR*: > > *case* SerialPortEvent.*RI*: > > *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: > > *break*; > > *case* SerialPortEvent.*DATA_AVAILABLE*: > > *try* { > > String result = > ""; > > *byte*[] buffer = *new* *byte*[10]; > > *int* len = 0; > > *while* ((len = getPort().getInputStream().read(buffer)) > 0) { > > result += > *new* String(buffer, 0, len); > > buffer = > *new* *byte*[10]; > > } > > processInput(result); > > } > *catch* (IOException e) { > > logger.error("PRPRO01: " + e.getMessage()); > > } > *catch* (Exception e) { > > logger.error("PRPRO02: " + e.getMessage()); > > } > > *break*; > > } > > } > > Any help would be apreciated. > > > Atenciosamente, > F?bio Cristiano dos Anjos > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081104/94804b6a/attachment-0081.html From fabioanjos at gmail.com Wed Nov 5 04:18:00 2008 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Wed, 5 Nov 2008 09:18:00 -0200 Subject: [Rxtx] Strange characters when reading from Serial port In-Reply-To: References: <29788b250811040301l6de43422md5e1b9db6d69bd12@mail.gmail.com> Message-ID: <29788b250811050318n524176a9w161502bc9a2a879f@mail.gmail.com> Rien, Tanks for the reply. In fact, the client is using a Serial-to-USB converter. I'll check with them to see if there is a problem with it. Tanks again! Atenciosamente, F?bio Cristiano dos Anjos On Tue, Nov 4, 2008 at 8:35 PM, Rien Korstanje wrote: > F?bio, > > I have encountered a similair problem when using RXTX in combination with a > bad Serial-to-USB converter. If you don't have another one at hand, you > could also use the Hyper Terminal to see what the Serial Port is delivering. > > If you aren't using a Serial-to-USB converter, I don't have any > suggestions. > > Regards, > -Rien Korstanje > > > On Tue, Nov 4, 2008 at 12:01 PM, F?bio Cristiano dos Anjos < > fabioanjos at gmail.com> wrote: > >> Dear friends, >> >> We are using RXTX in our software since last april and we have succeded in >> most cases. >> But, in some clients we could observe a strage behaviour. >> In normal operation, the application reads data from serial port like the >> example below: >> >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:53 48 49 50 32 49 >> 56 67 67 50 48 69 51 50 49 48 49 48 48 48 20 (bytes) >> 29-10-2008 14:50:02 - DEBUG: Dado recebido na porta COM3:5012 >> 18CC20E32101000 (toString) >> >> Where 20, is the block terminator. >> >> Suddenly, the application starts to read strage characters from the same >> serial port: >> >> >> 29-10-2008 14:53:37 - DEBUG: Dado recebido na porta COM3:0 112 2 0 0 0 0 0 >> 48 54 33 -32 6 0 0 48 49 54 33 -32 6 0 0 0 0 0 0 0 0 0 57 57 40 0 0 0 0 0 48 >> 0 1 0 0 0 24 0 0 0 0 0 0 0 0 69 52 0 27 0 1 0 40 48 0 0 40 0 4 0 68 56 0 0 0 >> 0 0 0 49 50 0 0 0 0 0 0 0 0 0 0 24 0 0 0 -102 2 0 48 117 54 33 -32 6 0 48 53 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 88 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 0 0 0 0 0 >> 0 0 0 11 0 11 0 40 0 24 0 64 0 24 0 68 0 1 0 56 0 0 0 6 0 0 0 -102 2 0 0 0 0 >> 0 0 -36 75 12 0 0 0 -74 -12 0 -32 5 0 0 0 0 0 0 98 2 0 0 0 0 0 0 112 2 0 0 0 >> 0 0 0 -32 5 0 0 0 0 0 0 66 2 0 0 0 0 0 0 112 2 0 0 0 0 0 -122 54 33 -32 6 0 >> 0 0 117 54 33 -32 6 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0 0 0 0 0 1 0 0 0 24 0 0 0 >> 0 0 0 0 0 0 0 0 27 0 1 57 69 0 0 0 40 0 4 48 68 0 0 0 0 0 0 0 0 0 0 0 0 0 52 >> 49 0 0 0 0 24 0 20 0 -102 2 0 0 -111 >> >> The application continues to read strange chars from the serial port, >> until we restart it. >> >> We are using the RXTX 2.1.7 >> >> Here is the code used to read serial port: >> >> >> /* (non-Javadoc) >> >> * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) >> >> */ >> >> // @Override >> >> *public* *void* serialEvent(SerialPortEvent event) { >> >> >> >> *switch* (event.getEventType()) { >> >> *case* SerialPortEvent.*BI*: >> >> *case* SerialPortEvent.*OE*: >> >> *case* SerialPortEvent.*FE*: >> >> *case* SerialPortEvent.*PE*: >> >> *case* SerialPortEvent.*CD*: >> >> *case* SerialPortEvent.*CTS*: >> >> *case* SerialPortEvent.*DSR*: >> >> *case* SerialPortEvent.*RI*: >> >> *case* SerialPortEvent.*OUTPUT_BUFFER_EMPTY*: >> >> *break*; >> >> *case* SerialPortEvent.*DATA_AVAILABLE*: >> >> *try* { >> >> String result = >> ""; >> >> *byte*[] buffer = *new* *byte*[10]; >> >> *int* len = 0; >> >> *while* ((len = getPort().getInputStream().read(buffer)) > 0) { >> >> result += >> *new* String(buffer, 0, len); >> >> buffer = >> *new* *byte*[10]; >> >> } >> >> processInput(result); >> >> } >> *catch* (IOException e) { >> >> logger.error("PRPRO01: " + e.getMessage()); >> >> } >> *catch* (Exception e) { >> >> logger.error("PRPRO02: " + e.getMessage()); >> >> } >> >> *break*; >> >> } >> >> } >> >> Any help would be apreciated. >> >> >> Atenciosamente, >> F?bio Cristiano dos Anjos >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081105/c16435bf/attachment-0081.html From dev+lists at humph.com Thu Nov 6 16:15:35 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:15:35 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hello, this is my first post to this list, and I would like to start with a small contribution. I also work on Mac OS X and reading that I should have used the CVS version (to be 2.1-8, although it still reports itself as 2.1-7 for the moment) I got it and compiled it using Xcode 3.0. The Xcode project needs a bit of massaging, the paths to the java sources have to be reset, to do so I simply got rid of all the sources in the project Java/PB and reimported them. The SDK paths have to be changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 for PPC. RXTX works fine with these settings (no locks problem). Tested on Intel so far, as my only left PPC machine is far away... Then prompted by the 64bit post I decided to compile a quadruple architecture version (a very fat one!). This is simply done by adding 64 bit support in the target setting. This is how you do it: select librxtxSerial in the active target popup menu. Do command- option-E (alternatively Project->Edit Active Target menu item). In the target setting windows that opens select show: All Settings. At the top you will then find Architectures. That is set as ppc i386. Double click it and tick the 64 bit. Close the window, build and you are done. To check that the build process did the right thing you can run the command "file" on the library. So, from Terminal: $ file librxtxSerial.jnilib librxtxSerial.jnilib: Mach-O universal binary with 4 architectures librxtxSerial.jnilib (for architecture i386): Mach-O dynamically linked shared library i386 librxtxSerial.jnilib (for architecture ppc): Mach-O dynamically linked shared library ppc librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 Giuliano From dev+lists at humph.com Thu Nov 6 16:43:25 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Fri, 7 Nov 2008 00:43:25 +0100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: I realise that one detail have slipped from my previous post. On F 7 Nov, 2008, at 00:15 , Giuliano Gavazzi wrote: [...] > in the project Java/PB and reimported them. The SDK paths have to be > changed as 10.2 support is gone. So I use 10.4u for Intel and 10.3.9 > for PPC. the SDK are selected from the same setting window used to select the Architecture (the one called by command-option-E). It's only 24 hours since I found out about rxtx, so my results have only passed a very superficial test (a small programme that writes to a serial usb adapter). The functionality of the 64bit version has been verified by calling my programme with the -d64 option: java -d64 myprog that works with the 64 bit library but not with the other one. Indeed with the latter I get the same: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/ librxtxSerial.jnilib: thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/ Java/Extensions/librxtxSerial.jnilib: that Noel got. I think that I will hang around for quite a while, as my current project needs serial communication in Java on Mac OS and Windows... Giuliano From netbeans at gatworks.com Thu Nov 6 18:45:40 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 06 Nov 2008 20:45:40 -0500 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <49139DC4.7000609@gatworks.com> Giuliano Gavazzi wrote: > I realise that one detail have slipped from my previous post. > > Gee, all this appears to be new & improved. Are there any docs to explain jnilib? From dev+lists at humph.com Mon Nov 10 13:55:10 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Mon, 10 Nov 2008 21:55:10 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: References: Message-ID: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Sent this a few days ago, but just to myself... in the meantime I found the source, if not the cause, of the error. See at the bottom. There's a problem with the 64 bit version. I tested it on a iMac with 1GB of memory (might that be the problem?) and a Manhattan USB to serial adaptor. While without an attached serial device on the other end it works, when a serial device is attached it fails: java -d64 nulltest Default port set to '/dev/cu.usbserial' Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: '/dev/cu.usbserial' Attempting to initalize port '/dev/cu.usbserial' We opened port /dev/cu.usbserial first thingy worked. Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Writing "DS " to /dev/cu.usbserial Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial device was connected at this point Segmentation fault I have some other clue because when the serial device is connected from the start, I get the error only after the first write operation has been performed. Actually, the write works, it is the read operation that causes the failure: inputStream.read. java -d64 -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-133, mixed mode) Further debugging leads to these lines in read_byte_array: struct event_info_struct *eis = ( struct event_info_struct * ) get_java_var( env, *jobj,"eis","J" ); report_time_start(); flag = eis->eventflags[SPE_DATA_AVAILABLE]; the eis returned by get_java_var is 0x1281f9b0 that is not accessible. I wonder if that is a java bug, in GetIntField. Giuliano From netbeans at gatworks.com Mon Nov 10 14:52:09 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Nov 2008 16:52:09 -0500 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> Message-ID: <4918AD09.50609@gatworks.com> Probably not relevant the location accessed ( looks legit for a 32bit reference, ) the PC would be a better help. any debugging tools ( like gdb ) to get stack trace? any core dump ? > Invalid memory access of location 1284b9b8 rip=126f0ba8 << the serial > device was connected at this point > Segmentation fault From dev+lists at humph.com Mon Nov 10 16:20:38 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 00:20:38 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ In-Reply-To: <4918AD09.50609@gatworks.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com> <4918AD09.50609@gatworks.com> Message-ID: On M 10 Nov, 2008, at 22:52 , U. George wrote: > Probably not relevant the location accessed ( looks legit for a > 32bit reference, ) the PC would be a better help. > any debugging tools ( like gdb ) to get stack trace? any core dump ? > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the >> serial device was connected at this point >> Segmentation fault I did debug with gdb and the result is at the bottom of my prev message. But your message made me think.. I checked some other memory locations and they looked different, having the lowemost bit of the upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. So I added 0x100000000 to the result from GetIntField and the programme seems to run fine now. Submitted a bug to Apple, but I would like to know if anyone can test on another 64 bit platform. Giuliano From Howard at QtuTrains.com Mon Nov 10 17:06:11 2008 From: Howard at QtuTrains.com (QtuTrains) Date: Tue, 11 Nov 2008 13:06:11 +1300 Subject: [Rxtx] MAC OS X device driver Message-ID: <58320E55-5B04-40DE-9916-2C17EEA10025@QtuTrains.com> I have been using RXTX for a while on MAC OS X mostly, but also on Windows & Linux but on the MAC I get total GUI freezing occasionally, but only when the serial port is in use. The serial port is of course a USB serial adaptor. I never get similar problems on Windows or Linux. I assume the problem to be in the device driver for the PL2303 chip - I seem to remember a derogatory comment on this list a while ago, but cannot find it in the archives. Can anyone advise which of the many device drivers works best with these. many thanks, Howard Amos From Martin.Oberhuber at windriver.com Tue Nov 11 01:47:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 11 Nov 2008 09:47:35 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> Message-ID: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Perhaps it's a bug to try and store (void*) in an int field to start with? - When I'm not mistaken, Java is specified to always use 32-bit ints, so storing the (void*) in a long or byte[] should perhaps be considered. 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 Giuliano Gavazzi > Sent: Tuesday, November 11, 2008 12:21 AM > To: U. George > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] 64 bit invalid access in read. Was: MAC > OSX10.5 INTELand ImageJ > > > On M 10 Nov, 2008, at 22:52 , U. George wrote: > > > Probably not relevant the location accessed ( looks legit for a > > 32bit reference, ) the PC would be a better help. > > any debugging tools ( like gdb ) to get stack trace? any core dump ? > > > >> Invalid memory access of location 1284b9b8 rip=126f0ba8 << the > >> serial device was connected at this point > >> Segmentation fault > > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some > other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone > can test > on another 64 bit platform. > > Giuliano > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lfarkas at lfarkas.org Tue Nov 11 02:47:40 2008 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 11 Nov 2008 10:47:40 +0100 Subject: [Rxtx] new release in the near future? Message-ID: <491954BC.3040101@lfarkas.org> hi, can we wait a version 2.1-8 release in this year? thanks. ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 and epel-5 (for rhel/centos-5). -- Levente "Si vis pacem para bellum!" From kintel at sim.no Tue Nov 11 03:14:28 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:14:28 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTELand ImageJ In-Reply-To: <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> References: <78402EBF-D25B-4C92-A2E8-2B7B958E7469@humph.com><4918AD09.50609@gatworks.com> <460801A4097E3D4CA04CC64EE6485848087B6236@ism-mail03.corp.ad.wrs.com> Message-ID: Hi, This sounds awefully like the issues I had half a year ago. I'll reforward my suggested patch for that issue. Maybe one of you have the chance to verify that it (at least partially) improves the 64-bit situation. ~/= Marius -- We are Elektropeople for a better living. From kintel at sim.no Tue Nov 11 03:15:17 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 11:15:17 +0100 Subject: [Rxtx] Fwd: Mac 10.5.2 + JDK 1.6 (64-bit) jnilib References: Message-ID: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Begin forwarded message: > From: Marius Kintel > Date: June 5, 2008 4:45:46 PM GMT+02:00 > To: rxtx at qbang.org > Subject: Re: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib > > Hi, > > I just looked into this, and found a bug in rxtx causing the > "Invalid memory access of location" reported by Zach. > I wrote a quick and dirty fix for this (see attachment). The fix is > a corresponding fix for what Trent mentions (32-bit vs. 64-bit "eis" > variable), but in the native code. > > The attached diff is against the commapi-0-0-1 branch. > To build it in 64-bit mode on Mac OS X, you still need to patch the > makefile as described by Zach. > > ~/= Marius > > -- > We are Elektropeople for a better living. > -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.diff Type: application/octet-stream Size: 722 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081111/830e9b0c/attachment-0076.obj -------------- next part -------------- > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 04:34:33 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 12:34:33 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: ah! Thanks! How silly of me, no bug on Apple part, but a bug in RXTX. I could have tried in every conceivable way to retrieve the correct eis value, but as it was stored incorrectly to start with.... BTW, the patch is missing one thing: from: int get_java_var( JNIEnv *, jobject, char *, char * ); to: size_t get_java_var( JNIEnv *, jobject, char *, char * ); and correspondingly in the source. Giuliano From kintel at sim.no Tue Nov 11 05:47:19 2008 From: kintel at sim.no (Marius Kintel) Date: Tue, 11 Nov 2008 13:47:19 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> Message-ID: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > ah! Thanks! How silly of me, no bug on Apple part, but a bug in > RXTX. I could have tried in every conceivable way to retrieve the > correct eis value, but as it was stored incorrectly to start with.... > BTW, the patch is missing one thing: > [...] > Cool, I haven't followed up this lately, but if it is verified to improve matter and if it's still not in rxtx-svn, it would be nice to have the updated patch applied. This is going to bite hard now that more people migrate to 64-bit. ~/= Marius -- We are Elektropeople for a better living. From dev+lists at humph.com Tue Nov 11 06:07:05 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Tue, 11 Nov 2008 14:07:05 +0100 Subject: [Rxtx] Mac 10.5.2 + JDK 1.6 (64-bit) jnilib In-Reply-To: <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> References: <40E11F3A-B8EC-4C9D-9B02-A8869264ABF7@sim.no> <9FE0836C-77BE-488E-8CC3-9DF1CDE79566@sim.no> Message-ID: On T 11 Nov, 2008, at 13:47 , Marius Kintel wrote: > > On Nov 11, 2008, at 12:34 PM, Giuliano Gavazzi wrote: > >> ah! Thanks! How silly of me, no bug on Apple part, but a bug in >> RXTX. I could have tried in every conceivable way to retrieve the >> correct eis value, but as it was stored incorrectly to start with.... >> BTW, the patch is missing one thing: >> [...] >> > > Cool, I haven't followed up this lately, but if it is verified to > improve matter and if it's still not in rxtx-svn, it would be nice > to have the updated patch applied. > This is going to bite hard now that more people migrate to 64-bit. I have applied your patch manually and my patch too (or else the returned value looses the upper 32 bits). It seems to work here. It would definitely be nice to have it applied to the source from which the current binary is built (it's difficult to compile on Windows... just getting now MinGW). I can supply the universal binaries for Mac OS (either the lock-buggy current ones or the good CVS ones) or the updated Xcode project. Giuliano From tjarvi at qbang.org Tue Nov 11 22:07:13 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Nov 2008 22:07:13 -0700 (MST) Subject: [Rxtx] new release in the near future? In-Reply-To: <491954BC.3040101@lfarkas.org> References: <491954BC.3040101@lfarkas.org> Message-ID: On Tue, 11 Nov 2008, Farkas Levente wrote: > hi, > can we wait a version 2.1-8 release in this year? > thanks. > > ps. anyway i build and pushed rxtx-2.1-0.2.7r2 into fedora-9, fedora-10 > and epel-5 (for rhel/centos-5). > > Hi Farkas Yes there will be a release this year. I'm going through remaining bugs at work and preparing test binaries (win32/64 mac32/64/(ppc?) linux32/64 and (sol32?)/64) for rxtx.org. ? means they will be there but I'm not really testing them. The process is nontrivial. Once we put those out, the releases will spin fairly quickly until we (those willing to dig into code) are all happy. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Tue Nov 11 22:36:37 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 12 Nov 2008 16:36:37 +1100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: Message-ID: Re: 64 bit invalid access in read. Was: MAC OSX10.5 INTEL and ImageJ (Giuliano Gavazzi) > I did debug with gdb and the result is at the bottom of my prev > message. But your message made me think.. I checked some other memory > locations and they looked different, having the lowemost bit of the > upper 32 set, while 1284b9b8 did not. Remember, I am in 64 bit. > So I added 0x100000000 to the result from GetIntField and the > programme seems to run fine now. > Submitted a bug to Apple, but I would like to know if anyone can test > on another 64 bit platform. > > Giuliano > *********************************** Guiliano, I would be happy to test your code. If you send it to me as a mac archive I will be happy to try it on a PPC machine (with 7 Gb) or an intel machine with 32 Gb. I will also try to follow your instructions to produce my own, this will take me a little while. Regards Noel Goldsmith Air Vehicles Division Defence Science and Technology Organisation 506 Lorimer Street Port Melbourne Vic 3207 Ph 03 96267527 Fax 03 96267089 Mobile 0428364003 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 dev+lists at humph.com Wed Nov 12 01:02:48 2008 From: dev+lists at humph.com (Giuliano Gavazzi) Date: Wed, 12 Nov 2008 09:02:48 +0100 Subject: [Rxtx] 64 bit invalid access in read. Was: MAC OSX10.5 INTEL ImageJ (Giuliano Gavazzi) In-Reply-To: References: Message-ID: On W 12 Nov, 2008, at 06:36 , Goldsmith, Noel wrote: > Guiliano, > > I would be happy to test your code. If you send it to me as a mac > archive I > will be happy to try it on a PPC machine (with 7 Gb) or an intel > machine > with 32 Gb. > I will also try to follow your instructions to produce my own, this > will > take me a little while. > Regards > > Noel Goldsmith Noel, as you have seen from the development of the thread the bug was in RXTX code. I applied the patches suggested by Marius plus another required change to preserve the eis. I have just to recompile the library for 10.4 (at the moment it is compiled for 10.5 only...), if you require 10.3 I'll have to wait til I'm home at the other machine that has got the required SDK. Giuliano From matthew.fullerton at schepens.harvard.edu Wed Nov 12 13:18:45 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Wed, 12 Nov 2008 15:18:45 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? Message-ID: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Hi, I have been using RXTX successfully for a week or so and today tried to move my program to another Windows PC. Both systems are XP, both libraries are version 2.1, both JREs are 6u10. I'm using this section of code below (taken from the example at http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; // init reader thread //SerialInterface reader = new SerialInterface(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } // initalize serial port try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} My port is successfully found on the non failure system (on a USB to Serial converter - its COM6) but on the other machine I get a not CastableException (the target port is COM5 on the failure machine. The failed machine also has a 2nd USB to serial converter that is used for a modem). It is this line that causes the crash serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); because one cannot cast an LPRPort to a SerialPort. This I understand, but why is CommPortIdentifier.open generating an LPRPort on one machine, and a CommPort on the other? I really can't figure out what's going on, and can't find any mention of the error online. I'm desperate for help...! Thanks, Matt From rien.korstanje at gmail.com Wed Nov 12 16:46:53 2008 From: rien.korstanje at gmail.com (Rien Korstanje) Date: Thu, 13 Nov 2008 00:46:53 +0100 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: Apologies for sending again, but by accident I replied only to Matthew rather then the list. I'm still new to this thing. --- Hey Matthew this bit of code here is the problem: while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); //removed code } This will keep spinning until the last element in the list is reached, and thus the portId will be the last one in the list. For the example you took the code from it won't matter but for what you do it does. The quick and ugly way to solve your problem would be to hard code the portname when getting the comport identifiers like: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); Though you can also use CommPortIdentifier.getPortIdentifiers() first to get all the ports, filter out the parallel port, and list the serial port names on an interface and make your selection there. -Rien On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton < matthew.fullerton at schepens.harvard.edu> wrote: > Hi, > I have been using RXTX successfully for a week or so and today tried > to move my program to another Windows PC. Both systems are XP, both > libraries are version 2.1, both JREs are 6u10. > > I'm using this section of code below (taken from the example at > http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals(defaultPort)) { > System.out.println("Found port: "+defaultPort); > portFound = true; > // init reader thread > //SerialInterface reader = new SerialInterface(); > } > } > > } > if (!portFound) { > System.out.println("port " + defaultPort + " not found."); > } > > // initalize serial port > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > > > My port is successfully found on the non failure system (on a USB to > Serial converter - its COM6) but on the other machine I get a not > CastableException (the target port is COM5 on the failure machine. The > failed machine also has a 2nd USB to serial converter that is used for > a modem). It is this line that causes the crash > > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > because one cannot cast an LPRPort to a SerialPort. This I understand, > but why is CommPortIdentifier.open generating an LPRPort on one > machine, and a CommPort on the other? I really can't figure out what's > going on, and can't find any mention of the error online. I'm > desperate for help...! > > Thanks, > Matt > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/e5911c8e/attachment-0074.html From d at daniellewilde.com Wed Nov 12 20:59:53 2008 From: d at daniellewilde.com (danielle wilde) Date: Thu, 13 Nov 2008 14:59:53 +1100 Subject: [Rxtx] does rxtx support 230400 baud rate? Message-ID: <689cad490811121959u76ef6791q47515439ea2233a1@mail.gmail.com> I've been trawling sites for about an hour trying to get this info. can anyone advise? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/20630dbe/attachment-0074.html From donoso.d at ikusi.es Thu Nov 13 01:44:04 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 09:44:04 +0100 Subject: [Rxtx] Timeouts problems under windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435116A@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/6f67b0a7/attachment-0074.html From sebastien.jean.rxtx at gmail.com Thu Nov 13 04:21:40 2008 From: sebastien.jean.rxtx at gmail.com (=?ISO-8859-1?Q?S=E9bastien_Jean?=) Date: Thu, 13 Nov 2008 12:21:40 +0100 Subject: [Rxtx] Re : Timeouts problems under windows Message-ID: On Windows XP, the problem occurs. To solve it, you just have to enable a receive timeout long enough e.g. SerialPort port = .... port.enableReceiveTimeout(3600000) // wait for one hour Once done, every call to read will be blocking... Baz > Hello, > > I wan't to use rxtxcomm library in my Java Project to read and write data > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/646c5a6b/attachment-0074.html From Steffen.DETTMER at ingenico.com Thu Nov 13 05:29:13 2008 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 13 Nov 2008 13:29:13 +0100 Subject: [Rxtx] Re : Timeouts problems under windows In-Reply-To: References: Message-ID: <20081113122913.GA4945@elberon.bln.de.ingenico.com> * S?bastien Jean wrote on Thu, Nov 13, 2008 at 12:21 +0100: > * Daniel wrote: > > I wan't to use rxtxcomm library in my Java Project to read and write data > > from serial ports in Windows Vista. > > In some forums I read there is a problem with timeouts under windows. > > Is there any solution to solve the problem? > > On Windows XP, the problem occurs. > To solve it, you just have to enable a receive timeout long enough > e.g. > SerialPort port = .... > port.enableReceiveTimeout(3600000) // wait for one hour > Once done, every call to read will be blocking... but then he has a /real/ problem with timeouts, namely no useable timeouts at all, ain't? Which problem is it? Is it http://mailman.qbang.org/pipermail/rxtx/2007-April/3056951.html so maybe this http://mailman.qbang.org/pipermail/rxtx/2008-October/3125772.html workaround helps? Or is this issue solved and the workaround not needed any longer? 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 matthew.fullerton at schepens.harvard.edu Thu Nov 13 06:30:20 2008 From: matthew.fullerton at schepens.harvard.edu (Matthew Fullerton) Date: Thu, 13 Nov 2008 08:30:20 -0500 Subject: [Rxtx] LPRPort created instead of CommPort? In-Reply-To: References: <46bdfea60811121218g2a6049ebo8e7f16dcb6194bff@mail.gmail.com> Message-ID: <46bdfea60811130530w63bdaa80q86175d75aacc8be9@mail.gmail.com> Hi Rien, Thanks, I had only spotted that if it /didn't/ find the serial port, I could easily end up with the parallel port, but now I see how I could end up with it even if it really is there! The computer is at another location so I'll find out later today if it really is this simple. Thanks for the second pair of eyes!!! Matt 2008/11/12 Rien Korstanje : > Hey Matthew, > > this bit of code here is the problem: > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > //removed code > } > > This will keep spinning until the last element in the list is reached, and > thus the portId will be the last one in the list. For the example you took > the code from it won't matter but for what you do it does. > > The quick and ugly way to solve your problem would be to hard code the > portname when getting the comport identifiers like: > > CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); > SerialPort serialPort = (SerialPort) portId.open("SerialReader", 2000); > > Though you can also use CommPortIdentifier.getPortIdentifiers() first to get > all the ports, filter out the parallel port, and list the serial port names > on an interface and make your selection there. > > -Rien > > > On Wed, Nov 12, 2008 at 9:18 PM, Matthew Fullerton > wrote: >> >> Hi, >> I have been using RXTX successfully for a week or so and today tried >> to move my program to another Windows PC. Both systems are XP, both >> libraries are version 2.1, both JREs are 6u10. >> >> I'm using this section of code below (taken from the example at >> http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals(defaultPort)) { >> System.out.println("Found port: "+defaultPort); >> portFound = true; >> // init reader thread >> //SerialInterface reader = new SerialInterface(); >> } >> } >> >> } >> if (!portFound) { >> System.out.println("port " + defaultPort + " not found."); >> } >> >> // initalize serial port >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> } catch (PortInUseException e) {} >> >> >> My port is successfully found on the non failure system (on a USB to >> Serial converter - its COM6) but on the other machine I get a not >> CastableException (the target port is COM5 on the failure machine. The >> failed machine also has a 2nd USB to serial converter that is used for >> a modem). It is this line that causes the crash >> >> serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); >> >> >> because one cannot cast an LPRPort to a SerialPort. This I understand, >> but why is CommPortIdentifier.open generating an LPRPort on one >> machine, and a CommPort on the other? I really can't figure out what's >> going on, and can't find any mention of the error online. I'm >> desperate for help...! >> >> Thanks, >> Matt >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > From donoso.d at ikusi.es Thu Nov 13 06:34:02 2008 From: donoso.d at ikusi.es (Donoso Gabilondo, Daniel) Date: Thu, 13 Nov 2008 14:34:02 +0100 Subject: [Rxtx] Timeouts problems in windows Message-ID: <435A66F076E8344FA6D3917739BD99A40435180B@srviku004.ikusi.net> Hello, I wan't to use rxtxcomm library in my Java Project to read and write data from serial ports in Windows Vista. In some forums I read there is a problem with timeouts under windows. Is there any solution to solve the problem? Daniel From mathieu.sacrispeyre at novamems.com Thu Nov 13 07:22:56 2008 From: mathieu.sacrispeyre at novamems.com (Mathieu Sacrispeyre) Date: Thu, 13 Nov 2008 15:22:56 +0100 Subject: [Rxtx] Unexpected error on unplugging of device Message-ID: <491C3840.4090400@novamems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081113/46ee151b/attachment-0073.html From tjarvi at mathworks.com Thu Nov 13 13:30:40 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 15:30:40 -0500 Subject: [Rxtx] Mac patch for no driver installed. Message-ID: <200811132030.mADKUeFV021833@jarvitlinux.mathworks.com> Only in /local/Trash/Amake/3p/derived/win32/rxtx/src: .SerialImp.c.swo diff -ur /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c --- /local/Trash/Amake/3p/derived/win32/rxtx/src/SerialImp.c 2008-01-17 16:33:07.000000000 -0500 +++ /local/Trash/Amake/3p/sources/rxtx/src/SerialImp.c 2008-09-02 19:08:49.000000000 -0400 @@ -29,6 +29,7 @@ #endif /* __LCC__ */ #include #include +#include #include #include #include @@ -4462,7 +4463,7 @@ kern_return_t kernResult; mach_port_t masterPort; CFMutableDictionaryRef classesToMatch; - if ((kernResult=IOMasterPort(NULL, &masterPort)) != KERN_SUCCESS) + if ((kernResult=IOMasterPort( (int) NULL, &masterPort ) ) != KERN_SUCCESS) { printf( "IOMasterPort returned %d\n", kernResult); return kernResult; @@ -4523,9 +4524,13 @@ io_iterator_t theSerialIterator; io_object_t theObject; int numPorts = 0;/* dima it should initiated */ - if (createSerialIterator(&theSerialIterator) != KERN_SUCCESS) + + if (( createSerialIterator( &theSerialIterator ) != KERN_SUCCESS) || + ( ! IOIteratorIsValid( theSerialIterator))) { - printf( "createSerialIterator failed\n" ); + /* This also happens when no drivers are installed */ + report( "createSerialIterator failed\n" ); + return(0); } else { jclass cls; /* dima */ jmethodID mid; /* dima */ From tjarvi at mathworks.com Thu Nov 13 14:52:31 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:52:31 -0500 Subject: [Rxtx] [patch] remove some dead code. Message-ID: <200811132152.mADLqVWB023837@jarvitlinux.mathworks.com> Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.58 diff -u -r1.9.2.58 termios.c --- termios.c 26 Apr 2007 05:26:06 -0000 1.9.2.58 +++ termios.c 13 Nov 2008 21:51:14 -0000 @@ -1084,26 +1084,29 @@ if ( !first_tl ) { port->prev = NULL; + port->next = NULL; first_tl = port; } else { - while ( index->next ) + while ( ( index->fd < port->fd ) && index->next ) index = index->next; - if ( port == first_tl ) + if ( index->fd > port->fd ) { - port->prev = NULL; - port->next = first_tl; - first_tl->prev = port; - first_tl = port; + /* inserting previously closed fd */ + port->prev = index->prev; + port->next=index; + index->prev->next = port; + index->prev = port; } else { + /* adding to end of list */ port->prev = index; + port->next = NULL; index->next = port; } } - port->next = NULL; LEAVE( "add_port" ); return port; @@ -1390,10 +1393,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1451,9 +1450,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1488,24 +1484,15 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); return -1; } } else { -/* - usleep(1000); -*/ ClearErrors( index, &stat); return( total ); } @@ -1562,10 +1549,6 @@ report( "vmin=0\n" ); #endif /* DEBUG_VERBOSE */ ret = ClearErrors( index, &Stat); -/* - usleep(1000); - usleep(50); -*/ /* we should use -1 instead of 0 for disabled timeout */ now = GetTickCount(); if ( index->ttyset->c_cc[VTIME] && @@ -1625,9 +1608,6 @@ nBytes = 0; break; case ERROR_MORE_DATA: -/* - usleep(1000); -*/ report( "ERROR_MORE_DATA\n" ); break; case ERROR_IO_PENDING: @@ -1664,15 +1644,9 @@ } sprintf(message, "end nBytes=%ld] ", nBytes); report( message ); -/* - usleep(1000); -*/ report( "ERROR_IO_PENDING\n" ); break; default: -/* - usleep(1000); -*/ YACK(); errno = EIO; printf("6\n"); @@ -1681,9 +1655,6 @@ } else { -/* - usleep(1000); -*/ ClearErrors( index, &Stat); printf("7\n"); return( total ); @@ -3323,9 +3294,6 @@ } } end: -/* - usleep(1000); -*/ LEAVE( "serial_select" ); return( 1 ); #ifdef asdf From tjarvi at mathworks.com Thu Nov 13 14:56:25 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 16:56:25 -0500 Subject: [Rxtx] Uncle George's concurrency patch. Message-ID: <200811132156.mADLuPEx023915@jarvitlinux.mathworks.com> Appears to work well. Index: RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXPort.java,v retrieving revision 1.27.2.75 diff -u -r1.27.2.75 RXTXPort.java --- RXTXPort.java 18 Nov 2007 22:32:41 -0000 1.27.2.75 +++ RXTXPort.java 13 Nov 2008 21:54:56 -0000 @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. -| Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org and others who +| Copyright 1997-2008 by Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -140,6 +140,7 @@ /* dont close the file while accessing the fd */ int IOLocked = 0; + Object IOLockedMutex = new Object(); /** File descriptor */ private int fd = 0; @@ -1128,25 +1129,23 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); - if ( fd == 0 ) - { - IOLocked--; - throw new IOException(); + synchronized (IOLockedMutex) { + IOLocked++; } - try - { + try { + waitForTheNativeCodeSilly(); + if ( fd == 0 ) + { + throw new IOException(); + } writeByte( b, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** * @param b[] @@ -1164,20 +1163,19 @@ return; } if ( fd == 0 ) throw new IOException(); - IOLocked++; - waitForTheNativeCodeSilly(); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + waitForTheNativeCodeSilly(); writeArray( b, 0, b.length, monThreadisInterrupted ); if (debug_write) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } finally { + synchronized(IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** @@ -1208,20 +1206,20 @@ { return; } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); writeArray( send, 0, len, monThreadisInterrupted ); if( debug_write ) z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } finally { + synchronized (IOLockedMutex) { + IOLocked--; + } } - catch( IOException e ) - { - IOLocked--; - throw e; - } - IOLocked--; } /** */ @@ -1237,25 +1235,27 @@ z.reportln( "RXTXPort:SerialOutputStream:flush() Leaving Interrupted"); return; } - IOLocked++; - waitForTheNativeCodeSilly(); - /* - this is probably good on all OS's but for now - just sendEvent from java on Sol - */ + synchronized(IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); + /* + this is probably good on all OS's but for now + just sendEvent from java on Sol + */ if ( nativeDrain( monThreadisInterrupted ) ) sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); if (debug) z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); } - catch( IOException e ) + finally { - IOLocked--; - throw e; + synchronized (IOLockedMutex) { + IOLocked--; + } } - IOLocked--; } } @@ -1286,14 +1286,15 @@ { z.reportln( "+++++++++ read() monThreadisInterrupted" ); } - IOLocked++; - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() L" ); - waitForTheNativeCodeSilly(); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() N" ); - try - { + synchronized (IOLockedMutex) { + IOLocked++; + } + try { + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() L" ); + waitForTheNativeCodeSilly(); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() N" ); int result = readByte(); if (debug_read_results) //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); @@ -1302,7 +1303,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1327,10 +1330,12 @@ { return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = read( b, 0, b.length); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); @@ -1338,7 +1343,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /* @@ -1438,10 +1445,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readArray( b, off, Minimum); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1449,7 +1458,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } @@ -1547,10 +1558,12 @@ z.reportln( "RXTXPort:SerialInputStream:read() Interrupted"); return(0); } - IOLocked++; - waitForTheNativeCodeSilly(); + synchronized (IOLockedMutex) { + IOLocked++; + } try { + waitForTheNativeCodeSilly(); result = readTerminatedArray( b, off, Minimum, t ); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); @@ -1558,7 +1571,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } /** @@ -1573,7 +1588,9 @@ } if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); - IOLocked++; + synchronized (IOLockedMutex) { + IOLocked++; + } try { int r = nativeavailable(); @@ -1584,7 +1601,9 @@ } finally { - IOLocked--; + synchronized (IOLockedMutex) { + IOLocked--; + } } } } From tjarvi at mathworks.com Thu Nov 13 15:16:11 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 17:16:11 -0500 Subject: [Rxtx] enumerated port changes. Message-ID: <200811132216.mADMGBQI024311@jarvitlinux.mathworks.com> move bluetooth ircomm to enumerated, add CDC/ACM devices. http://bugzilla.qbang.org/show_bug.cgi?id=51 Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/gnu/io/RXTXCommDriver.java,v retrieving revision 1.16.2.59 diff -u -r1.16.2.59 RXTXCommDriver.java --- RXTXCommDriver.java 18 Nov 2007 22:32:41 -0000 1.16.2.59 +++ RXTXCommDriver.java 13 Nov 2008 22:15:07 -0000 @@ -2,7 +2,7 @@ | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface. | RXTX is a native interface to serial ports in java. | Copyright 1998 Kevin Hester, kevinh at acm.org -| Copyright 2000-2007 Trent Jarvi tjarvi at qbang.org and others who +| Copyright 2000-2008 Trent Jarvi tjarvi at qbang.org and others who | actually wrote it. See individual source files for more information. | | A copy of the LGPL v 2.1 may be found at @@ -577,6 +577,8 @@ "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) }; CandidatePortPrefixes=Temp; } @@ -593,6 +595,7 @@ "ttyircomm", // linux IrCommdevices (IrDA serial emu) "ttycosa0c", // linux COSA/SRP synchronous serial card "ttycosa1c", // linux COSA/SRP synchronous serial card + "ttyACM",// linux CDC ACM devices "ttyC", // linux cyclades cards "ttyCH",// linux Chase Research AT/PCI-Fast serial card "ttyD", // linux Digiboard serial card From tjarvi at mathworks.com Thu Nov 13 16:08:49 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:08:49 -0500 Subject: [Rxtx] [patch] enable threshold in SerialImp.c Message-ID: <200811132308.mADN8nGa025308@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=85 @@ -3287,8 +3288,7 @@ ENTER( "RXTXPort:NativeEnableRecieveTimeoutThreshold" ); if( tcgetattr( fd, &ttyset ) < 0 ) goto fail; - /* TESTING ttyset.c_cc[ VMIN ] = threshold; */ - ttyset.c_cc[ VMIN ] = 0; + ttyset.c_cc[ VMIN ] = threshold; ttyset.c_cc[ VTIME ] = timeout/100; if( tcsetattr( fd, TCSANOW, &ttyset ) < 0 ) goto fail; From tjarvi at mathworks.com Thu Nov 13 16:17:37 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 18:17:37 -0500 Subject: [Rxtx] [patch] select/EINTR Message-ID: <200811132317.mADNHbZG025497@jarvitlinux.mathworks.com> http://bugzilla.qbang.org/show_bug.cgi?id=89 On my PowerPC platform, it seems that a signal sometimes causes "select" to return EINTR. I have hacked the SerialImp.c file to do some retries when it occurs. Lines: /* FIXME HERE Trent */ #ifndef WIN32 ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); ... Replaced by: /* FIXME HERE Trent */ #ifndef WIN32 do { ret = SELECT( fd + 1, &rset, NULL, NULL, tvP ); } while (ret < 0 && errno==EINTR); From tjarvi at mathworks.com Thu Nov 13 18:44:32 2008 From: tjarvi at mathworks.com (Trent Jarvi) Date: Thu, 13 Nov 2008 20:44:32 -0500 Subject: [Rxtx] [patch] 1.5 stopbits fix. Message-ID: <200811140144.mAE1iWoB006786@jarvitlinux.mathworks.com> cvs diff: Diffing . Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.197 diff -r1.46.2.197 SerialImp.c 593c593,600 < case CSTOPB: stop_bits = STOPBITS_2; break; --- > case CSTOPB: > if ( ttyset.c_cflag & databits == JDATABITS_5) { > stop_bits = STOPBITS_1_5; > } > else { > stop_bits = STOPBITS_2; > } > break; 1130a1138 > (*cflag) |= CSTOPB; Index: termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.59 diff -r1.9.2.59 termios.c 1817,1818c1817,1827 < if ( s_termios->c_cflag & CSTOPB ) dcb->StopBits = TWOSTOPBITS; < else dcb->StopBits = ONESTOPBIT; --- > if ( s_termios->c_cflag & CSTOPB ) > { > if (dcb->ByteSize == 5) > { > dcb->StopBits = ONE5STOPBITS; > } else dcb->StopBits = TWOSTOPBITS; > } > else > { > dcb->StopBits = ONESTOPBIT; > } 2078,2079c2087,2091 < } < if ( myDCB.StopBits == ONESTOPBIT ) --- > } else if ( myDCB.StopBits == ONE5STOPBITS > { > s_termios->c_cflag |= CSTOPB; > s_termios->c_cflag |= CS5; > } else if ( myDCB.StopBits == ONESTOPBIT ) From tjarvi at qbang.org Sat Nov 15 18:11:42 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Nov 2008 18:11:42 -0700 (MST) Subject: [Rxtx] CVS/Next release status Message-ID: Everything I have is in CVS for the functional com aspects but I'm investigating one or two regressions. They may be the same thing. After that I'll just add the loadlib fixes for web installs. The problems are related to output buffer events on w32 as far as I can tell so far. More to come. I'm also working through solaris builds - trying to eliminate some lib deps so they work out of the box for everyone. Once there are no regressions, we can add anything else people need in and just confirm it is OK. I can run the 'tests' after that for eveyrones benefit. I've also added a couple one line fixes in CVS to the patches posted here if you noticed the patches have minor issues. I was trying to make sure the concepts got posted individually for review and made a couple mistakes in the code. I encourage others to do the same if you want fixes in. One thing I may play with is eliminating the TIOCGETLSR Linux specific portion with the POSIX flush thread. I suspect this is actually causing problems on Linux by sending too many events. That may be done after the release. It is tempting to just rip out a bunch of 10 year old trash in the code but we should do a stable release first. -- Trent Jarvi tjarvi at qbang.org From rxtx at qbang.org Thu Nov 20 12:40:23 2008 From: rxtx at qbang.org (rxtx at qbang.org) Date: Thu, 20 Nov 2008 12:40:23 -0700 Subject: [Rxtx] MedHelp id 53066677 Message-ID: <200811201940.mAKJeN20016683@rxtx.qbang.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20081120/3fecc891/attachment-0067.html From ehjuerrens at uni-muenster.de Tue Nov 25 10:39:54 2008 From: ehjuerrens at uni-muenster.de (=?UTF-8?Q?Eike_Hinderk_J=C3=BCrrens?=) Date: Tue, 25 Nov 2008 18:39:54 +0100 Subject: [Rxtx] USB to serial adapter Message-ID: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello out there, I am looking for an usb to serial adapter that works fine with linux and windows using rxtx/Java. Can you recommend any to me (not to expensive)? I will buy it here in germany. Thank you for your help Eike - -- Eike Hinderk J?rrens ehjuerrens at uni-muenster.de N51?56'28.02'' E7?36'35.72'' -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: http://getfiregpg.org iEYEARECAAYFAkksOGgACgkQ820dQiNIWcnrrACfWh2yqOTEKR4nq1PzUXqoYtvY rEwAn1Gri5MWqFkk+G4J4qRC8W2BJs9i =YYbw -----END PGP SIGNATURE----- From Martin.Oberhuber at windriver.com Tue Nov 25 15:45:35 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 25 Nov 2008 23:45:35 +0100 Subject: [Rxtx] rxtx unittests Message-ID: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Hi Trent, I remember that you said at one point that you had some testsuite for RXTX - but I cannot find anything related in the CVS repo. I would like to create some unittests for my refactoring of the port locking code, could you let me know of any framework that this should best fit in? Thanks, -- 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/20081125/2f47d945/attachment-0062.html From tjarvi at qbang.org Tue Nov 25 16:22:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:22:18 -0700 (MST) Subject: [Rxtx] rxtx unittests In-Reply-To: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808A24D1E@ism-mail03.corp.ad.wrs.com> Message-ID: On Tue, 25 Nov 2008, Oberhuber, Martin wrote: > Hi Trent, > > I remember that you said at one point that you had some testsuite for > RXTX - but I cannot find anything related in the CVS repo. > > I would like to create some unittests for my refactoring of the port > locking code, could you let me know of any framework that this should > best fit in? > > Thanks, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > Hi Martin There are no unit tests in rxtx at this time. At work we have a test suite which depends upon MATLAB and the test harness there to test. We are slowly working towards the point of having a compiled application that will run that test suite people can use if they like. It will be large and foreign to most folks. Differentiating rxtx test failures from product test failures is an art. For now, it makes sense for me to run the MATLAB testsuite and deal with any regressions after your changes are in. Just let me know when you hit a landing spot. Feel free to add any unit tests you have to the CVS repo. Ideally, there will be a complete open source test suite eventually. If you are adding the code, you get to pick the framework - code speaks. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 25 16:30:57 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 25 Nov 2008 16:30:57 -0700 (MST) Subject: [Rxtx] USB to serial adapter In-Reply-To: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> References: <87f2add00811250939p5c9a00f8l6f079ef632a5b14e@mail.gmail.com> Message-ID: On Tue, 25 Nov 2008, Eike Hinderk J?rrens wrote: > Hello out there, > I am looking for an usb to serial adapter that works fine with linux > and windows using rxtx/Java. > Can you recommend any to me (not to expensive)? I will buy it here in germany. > Thank you for your help Hi Eike The two main types we see are based upon FTDI chips and pl2303 chips. You can google for 'serial linux/windows XXXX problem' and make up your own mind. If the vendor has been supporting Linux/Windows for ~4 years, they are probably OK now. The kernel drivers have matured. Just make sure the kernel driver you use isn't 4 years old :) Most of the 'usb serial' problems I hear about now are related to bluetooth. -- Trent Jarvi tjarvi at qbang.org From talberts at msiscales.com Tue Nov 25 17:10:19 2008 From: talberts at msiscales.com (Tim Alberts) Date: Tue, 25 Nov 2008 16:10:19 -0800 Subject: [Rxtx] RXTX web install Message-ID: <492C93EB.6030008@msiscales.com> Greetings, I'm new to the list and soon to be new to using RXTX. I've been using Sun's old javax.comm 2.0 on windows for years and haven't had problems, but would like to update to something supported. I'm also converting my applications to run via web start. I've seen the link on: http://users.frii.com/jarvi/rxtx/download.html regarding DocJava.com and Dr Douglas Lyon working on an experimental web install. I've used this on a few windows machines and it looks like it works perfectly. I'd like to do a similar project, or help Dr Douglas Lyon continue with what he has. Ideally, I need a simple way to install on Windows/Mac/Linux clients. So if I can ask this mailing list if anyone has updated information on the support for web install. Does what Dr Douglas Lyon provide install for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's post to this list on 20081115 (subject CVS/Next release status) that there will be some upcoming fixes for web install. What are the fixes? From tjarvi at qbang.org Thu Nov 27 12:53:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:53:48 -0700 (MST) Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > Studio). > Changes required were: > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > sources under gnu/io > * Fix a typo (missing character) in termios.c > > * Fix includes in ParallelImp.c, win32termios.h for newer > structure > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > All changes are attached as patch. I don't think that there is an impact > on platforms other than Windows. > I did a quick smoke test with the build output for serial only. > Trent: should I commit these changes? > Please do, I'll test the builds with the microsoft compiler too. I think there is a missing ) in the cvs source right now. It should be obvious. A SerialImp.c change I posted here introduced it and I forgot to fix it. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:54:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:54:48 -0700 (MST) Subject: [Rxtx] Rev up RXTX version to 2.2 In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0042@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch revs up the RXTX version to 2.2 (and gets rid of some > trailing whitespace). > Ok to commit? > > Cheers, > -- > Martin Oberhuber, Senior Member of Technical Staff, Wind River > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > > No objection here. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 27 12:56:51 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 12:56:51 -0700 (MST) Subject: [Rxtx] RXTX web install In-Reply-To: <492C93EB.6030008@msiscales.com> References: <492C93EB.6030008@msiscales.com> Message-ID: On Tue, 25 Nov 2008, Tim Alberts wrote: > Greetings, I'm new to the list and soon to be new to using RXTX. I've > been using Sun's old javax.comm 2.0 on windows for years and haven't had > problems, but would like to update to something supported. I'm also > converting my applications to run via web start. I've seen the link on: > > http://users.frii.com/jarvi/rxtx/download.html > > regarding DocJava.com and Dr Douglas Lyon working on an experimental web > install. I've used this on a few windows machines and it looks like it > works perfectly. I'd like to do a similar project, or help Dr Douglas > Lyon continue with what he has. Ideally, I need a simple way to install > on Windows/Mac/Linux clients. > > So if I can ask this mailing list if anyone has updated information on > the support for web install. Does what Dr Douglas Lyon provide install > for Windows/Mac/Linux (is it open source)? I see from Trent Jarvi's > post to this list on 20081115 (subject CVS/Next release status) that > there will be some upcoming fixes for web install. What are the fixes? > Hi Tim, We do have an open source contribution comming after the functionality of 2.2 comes in. I also need to talk to Doug about his solution. I understand Doug want's to publish how he did it. If you can wait a bit, I'd like to deal with the web install as a seperate item. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 27 13:06:24 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:06:24 +0100 Subject: [Rxtx] Patches for making RXTX compile on Windows natively In-Reply-To: References: <460801A4097E3D4CA04CC64EE648584808AB0041@ism-mail03.corp.ad.wrs.com> Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0048@ism-mail03.corp.ad.wrs.com> Done. It builds fine now with Makefile.msvc and Makefile.mingw32. I didn't test the mingw-cross setup. 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: Thursday, November 27, 2008 8:54 PM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: Re: Patches for making RXTX compile on Windows natively > > On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > > > Hi all, > > > > I've retrofitted RXTX to build on Windows (with mingw32, or Visual > > Studio). > > Changes required were: > > > > > > * Fix and simplify Makefile.mingw32, Makefile.msvc for Java > > sources under gnu/io > > * Fix a typo (missing character) in termios.c > > > > * Fix includes in ParallelImp.c, win32termios.h for newer > > structure > > > > * Fix instructions (INSTALL, PORTING) for latest mingw32 and msvc > > > > All changes are attached as patch. I don't think that there > is an impact > > on platforms other than Windows. > > I did a quick smoke test with the build output for serial only. > > Trent: should I commit these changes? > > > > Please do, > > I'll test the builds with the microsoft compiler too. > > I think there is a missing ) in the cvs source right now. It > should be > obvious. A SerialImp.c change I posted here introduced it > and I forgot to > fix it. > > -- > Trent Jarvi > tjarvi at qbang.org > From Martin.Oberhuber at windriver.com Thu Nov 27 13:20:34 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 27 Nov 2008 21:20:34 +0100 Subject: [Rxtx] Initial Unittests for RXTX Message-ID: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Hi all, attached patch adds initial Unittests for RXTX. For now, there's just 3 very basic testcases (all around getPortIdentifiers()), but they are good enough to have an initial sanity test. The tests require that junit-3.8.2 is downloaded (from http://www.junit.org/). The tests are located next to src/ : rxtx-devel/src/... rxtx-devel/tests/gnu/io/rxtx/tests/ RXTXTestSuite RXTXCommDriverTest CommPortIdentifierTest Build support is only integrated into Makefile.msvc and Makefile.mingw32 for now -- adding build support to automake / the generic UNIX Makefile is TODO. On Windows, tests are executed with make tests Ok to commit? 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/20081127/b6776a70/attachment-0060.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_tests.patch Type: application/octet-stream Size: 19947 bytes Desc: rxtx_tests.patch Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20081127/b6776a70/attachment-0060.obj From tjarvi at qbang.org Thu Nov 27 13:26:47 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 27 Nov 2008 13:26:47 -0700 (MST) Subject: [Rxtx] Initial Unittests for RXTX In-Reply-To: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584808AB0049@ism-mail03.corp.ad.wrs.com> Message-ID: On Thu, 27 Nov 2008, Oberhuber, Martin wrote: > Hi all, > > attached patch adds initial Unittests for RXTX. > > For now, there's just 3 very basic testcases (all around > getPortIdentifiers()), but they are good enough to have an initial > sanity test. The tests require that junit-3.8.2 is downloaded (from > http://www.junit.org/). The tests are located next to src/ : > > rxtx-devel/src/... > rxtx-devel/tests/gnu/io/rxtx/tests/ > RXTXTestSuite > RXTXCommDriverTest > CommPortIdentifierTest > > Build support is only integrated into Makefile.msvc and Makefile.mingw32 > for now -- adding build support to automake / the generic UNIX Makefile > is TODO. On Windows, tests are executed with > > make tests > > Ok to commit? > No objections here. As long as the patches are discrete, I'd assume the patches go into CVS and anyone can flag and discuss when they have time to review them. -- Trent Jarvi tjarvi at qbang.org From Noel.Goldsmith at dsto.defence.gov.au Sun Nov 2 22:15:31 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Mon, 03 Nov 2008 16:15:31 +1100 Subject: [Rxtx] MAC OSX10.5 INTEL and ImageJ Message-ID: Hi, With reference to the message on Tue Oct 21 17:41:16 MDT 2008 I am sorry I didn't include the errors I got. Ran a plug-in to use the stage. > > And using ImageJ it works fine. > But using ImageJ64 bit I get a list of complaints. > Note that ImageJ works fine until I try to use a serial port. I have 24 Gb > of Ram allocated to it, and it handles it. > > Now I guess this is to do with something about 64 bit. > If you could make any suggestions that would be good. > I am happy to try stuff out and share this with the list. I suppose one should first ask - what are the complaints ? Is it the 24gb? Noel Replies. Here are the errors I get when I run ImageJ64 and try to use the stage. java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/librxtxSerial.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1715) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at SerialConnection.openConnection(SerialConnection.java:84) at MicroComm.openConnection(MicroComm.java:147) at Measure_XYZ.run(Measure_XYZ.java:46) at ij.IJ.runUserPlugIn(IJ.java:173) at ij.IJ.runUserPlugIn(IJ.java:184) at ij.IJ.runPlugIn(IJ.java:139) at ij.Executer.runCommand(Executer.java:104) at ij.Executer.run(Executer.java:58) at java.lang.Thread.run(Thread.java:613) Some of the java codes I were calling are called Measure_XYZ and MicroComm. I am now thinking that this failure to work might be due to the fact that I might not have compiled rxtx for 64 bits on the intel chip (I can check when I get to the iMac with X code on it). If anyone has I would be grateful if they would share with me their recipe. The following detail what I did a few months ago.